<?php
namespace Home\Controller;
use Think\Controller;
use Home\Common\Api\index;
class ChatController extends BaseController {
      public $index_song = null;
      protected function _initialize(){
        parent::_initialize();
      $this->index_song = new Index();
      }
    //获取首页内容
    public function index(){
        $t = time();
        $start_time = date("Y-m-d  00:00:00");
        $end_time = date("Y-m-d  23:59:59");
        $where['createtime'] = array('between',array($start_time,$end_time));
        // $lists = $this->index_song->chat_data($start_time,$end_time);
        $_lists = M('chat')->alias('a')->where($where)->join('left join song_user b on b.id = a.user_id ')->order('a.id asc')->field("a.*,b.face")->select();
        $this->assign('lists',$_lists);
        $this->assign('user_id',$_SESSION['user_id']);
        $this->assign('user_name',$_SESSION['user_name']);
    	  $this->assign('action','chat');
        $this->display();
    }
}
